<%--
 *  File:    UploadSummaryContact.jsp
 *  @Author: wangmin 
 *  Date:    2012/09/09
 *
 *  Copyright (C) 2000 - 2008 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/oval-tag.tld" prefix="oval" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<%
  //init param
  String privilegeCode = "11403";
  String strTableName = "";
  String strModuleName = "PCM";
  String contextPath = request.getContextPath();
%>
<%@ include file="/inc/CommonHeader.inc" %>
<%@ include file="/inc/OvalLocationDefault.inc" %>
<%@ include file="/rpt/ReportURL.inc"%>
<html>
<head>
<title>UploadSummaryContact</title>
<PageFlow:CheckPageFlow pageName="p_tempcontact"/>
<%@ include file="/inc/CatchError.inc" %>
<%
Vector totalsummary = (Vector)pageContext.getAttribute("totalsummary");
Vector provector = (Vector)pageContext.getAttribute("provector");
if(totalsummary == null) totalsummary = new Vector();
if(provector == null) provector = new Vector();
String allflag = (String)pageContext.getAttribute("allflag");
HashMap UserInfo = (HashMap)session.getAttribute("userinfo");
if(UserInfo == null) UserInfo = new HashMap();

HashMap prohash=new HashMap();
for(int i=0;i<provector.size();i++){
	  prohash.put(((HashMap)provector.get(i)).get("numcode"),((HashMap)provector.get(i)).get("productgroupname"));
}
%>
<link rel="stylesheet" href="<%=contextPath%>/css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="<%=contextPath%>/css/cn/script.js"></script>
<script language="JavaScript" src="<%=contextPath%>/js/ScriptLib.js"></script>
<script language="JavaScript" src="<%=contextPath%>/js/FuncLib.js"></script>
<%@ include file="/inc/SummaryDivision.inc" %>

<script language="JavaScript">
<%--  put your custom script here   --%>
function page_summary(actionvalue,orderbyname)
{
  var editform = summaryPrepare(cform,actionvalue,orderbyname);
  if(!editform) return;
  editform.action = "UploadSummaryContact.jsp?<%= OvalTools.randomURL() %>";
  editform.target = "_self";
  isRunning = true;
  editform.submit();
}

function page_check()
{
    cform.actionname.value = "check";
    cform.target = "_self";
    isRunning = true;
    cform.submit();
}

function page_confirm(){
    //if(nullChecked(document.cform.uploaduserids))
      //  {
         // alert("<%= message.getMessageDesc("PLEASE_SELECT") %>");
          //return;
       // }
	cform.actionname.value = "confirm";
    cform.target = "_self";
    isRunning = true;
    cform.submit();
}

function page_giveup(){
	var flag1 = confirm("<%= message.getMessageDesc("SURE_GIVE_UP")%>");
	if(!flag1){
		return;
	}
	cform.actionname.value = "giveup";
    cform.target = "_self";
    isRunning = true;
    cform.submit();
}	

function page_operate(operand)
{
	if(cform.filename.value === "" || cform.filename.value === null){
		return false;
	}
		  if (operand=="upload")
		  {
		    cform.encoding="multipart/form-data";
		    cform.actionname.value = "upload";
		    cform.target = "_self";
		    cform.submit();
		  }
	  
}
function page_print(){
    var url1 = "<%=reportURL%>/servlet/ExcecuteReport/temp_contact.sox?__format=xlsx&__folder=/ovalreport&userids="+document.cform.userid.value;
	 	var strstatus="height=768, width=1024,top=0,left=0,toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no";
    popwindow = window.open(url1, "n1window", strstatus);	
}

function allcheckselect(){
	var allcheck = cform.allcheck.checked;
	var uploaduserids = document.getElementsByName('uploaduserids');
	var length = uploaduserids.length;
	if(allcheck){
		for(var i = 0 ; i < length;i++){
			uploaduserids[i].checked = true;
		}
	}else{
		for(var i = 0 ; i < length;i++){
			uploaduserids[i].checked = false;
		}	
	}
}

function page_confirm1(){
	 /*   if(nullChecked(document.cform.uploadorgids))
	        {
	          alert("<%= message.getMessageDesc("PLEASE_SELECT") %>");
	          return;
	        }*/
		cform.actionname.value = "confirm1";
	    cform.target = "_self";
	    isRunning = true;
	    cform.submit();
	}

//审批提交
function page_submit(){
	//cform.pagename.value="p_temporg112";
	cform.actionname.value = "submit";
    cform.target = "_self";
    isRunning = true;
    cform.submit();
}
</script>
</head>

<body style="overflow: auto;">
<form name="cform" method="post" action="<%=contextPath%>/Dispatcher">
    <input type="hidden" name="pagename" value="p_tempcontact">
    <input type="hidden" name="actionname">
    <input type="hidden" name="name">
    <input type="hidden" name="type">
    <input type="hidden" name="sheetname" value="contactinfo">
    <input type="hidden" name="flag" value="contact">
    <input type="hidden" name="subjectcode" value="804">
    <!-- 
    <input type="hidden" name="begioncolumn" value="5">
    <input type="hidden" name="endcolumn" value="43">
    <input type="hidden" name="standardnum" value="2">
     -->
    <input type="hidden" name="codeinsheet" value = "Y"/>
    <input type="hidden"
	name="__header__Content-disposition" id="outname"
	value="attachment;filename=ContactMasterData.xls" />
	<custom:hidden scope="session" name="userinfo" property="userid"></custom:hidden>

<%--  page location   --%>
    <%@ include file="/inc/PageLocation.inc" %>

    <table width="100%" cellspacing="0" border="0" cellpadding="0">
      <tr>
<%--  search criteria  --%>
      </tr>
      <tr>
        <td>
          <table width="100%" border="0" cellspacing="0">
             <tr>
			  <td> 
			  	<%= label.getLabelName("L_Path") %><%= label.getLabelName("L_Colon") %><input type="file" name="filename" size="30" >
			    &nbsp;&nbsp;&nbsp;&nbsp;<a onclick="page_operate('upload')"><custom:button type="1" label="L_Finish" imgsrc="finish.gif" border="0" style="width:60"/></a>
			    
			  </td>
			 </tr>
          </table>
        </td>
      </tr>
      <tr>
        <td>
<div style="overflow:auto;width:1320;height:400">
          <table width="6400" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0" align="center">
            <tr class="deepblue-left">
<!--              <td class="title_center"  width="1%">&nbsp;<input type="checkbox" name="allcheck" class="normalradio" onclick="allcheckselect();"></td>-->
              <td class="title_center" rowspan="2" nowrap="nowrap"><%= label.getLabelName("L_BusinessUserCode") %></td>
              <td class="title_center" rowspan="2" nowrap="nowrap"><%= label.getLabelName("L_UserNumber") %></td>
              <td class="title_center" rowspan="2" nowrap="nowrap"><%= label.getLabelName("L_BusinessUserName") %></td>
              <td class="title_center" rowspan="2" nowrap="nowrap"><%= label.getLabelName("L_StatusName") %></td>
              <td class="title_center" rowspan="2" nowrap="nowrap"><%= label.getLabelName("L_GenderName") %></td>
              <td class="title_center" rowspan="2" nowrap="nowrap"><%= label.getLabelName("L_DeptName") %></td>
              <td class="title_center" rowspan="2" nowrap="nowrap"><%= label.getLabelName("L_TitleName") %></td>
             
             <!-- 
              -->
              <td class="title_center" rowspan="2" nowrap="nowrap"><%= label.getLabelName("L_Station") %></td>
              <td class="title_center" rowspan="2" nowrap="nowrap"><%= label.getLabelName("L_EmpleoyeeType") %></td>
              <td class="title_center" rowspan="2" nowrap="nowrap"><%= label.getLabelName("L_YesOrNoBale") %></td>
              <td class="title_center" rowspan="2" nowrap="nowrap"><%= label.getLabelName("L_EducationalLevel") %></td>
              
              <td class="title_center" rowspan="2" nowrap="nowrap"><%= label.getLabelName("L_MarriageStatusName") %></td>
              <td class="title_center" rowspan="2" nowrap="nowrap"><%= label.getLabelName("L_IDNumber") %></td>
              <td class="title_center" rowspan="2" nowrap="nowrap"><%= label.getLabelName("L_PrivateBankAccount") %></td>
              <td class="title_center" rowspan="2" nowrap="nowrap"><%= label.getLabelName("L_ContactMethod") %></td>  
                          
              <td class="title_center" rowspan="2" nowrap="nowrap"><%= label.getLabelName("L_Email") %></td>
              <td class="title_center" rowspan="2" width="200"><%= label.getLabelName("L_Address") %></td>
              <td class="title_center" rowspan="2" nowrap="nowrap"><%= label.getLabelName("L_ZipCode1") %></td>         
              
              <td class="title_center" rowspan="2" width="80"><%= label.getLabelName("L_employeenameUp")+label.getLabelName("L_Code") %></td>
              <td class="title_center" rowspan="2" width="80"><%= label.getLabelName("L_employeenameUp")+label.getLabelName("L_Name") %></td>
              
              <td class="title_center" rowspan="2" nowrap="nowrap"><%= label.getLabelName("L_Sort") %></td>         
              <!-- 
               -->
              <td class="title_center" rowspan="2" nowrap="nowrap"><%= label.getLabelName("L_ProvincesManagerCode") %></td> 
              <td class="title_center" rowspan="2" nowrap="nowrap"><%= label.getLabelName("L_ProvincesManagerName") %></td> 
             
              
              
              <td class="title_center" rowspan="2" nowrap="nowrap"><%= label.getLabelName("L_Provicetdr") %></td>              
              <td class="title_center" rowspan="2" nowrap="nowrap"><%= label.getLabelName("L_Begindate") %></td>   
              <td class="title_center" rowspan="2" nowrap="nowrap"><%= label.getLabelName("L_Enddate") %></td>  
              
              <td class="title_center" rowspan="2" nowrap="nowrap"><%= label.getLabelName("L_Staffturnovertime") %></td>  
                            
              <td class="title_center" rowspan="2" width="90"><%= label.getLabelName("L_Userqty") %></td> 
              
              <td class="title_center" rowspan="2" width="200"><%= label.getLabelName("L_USEDQTY") %></td> 
              	
              <td class="title_center" rowspan="2" width="80"><%= label.getLabelName("L_BusinessType") %></td>
              <td class="title_center" rowspan="2" nowrap="nowrap"><%= label.getLabelName("L_BirthDay") %></td>
              
              <td class="title_center" rowspan="2" nowrap="nowrap"><%= label.getLabelName("L_ExInfo") %></td>
			  <td class="title_center" rowspan="2" nowrap="nowrap"><%= label.getLabelName("L_ExInfo") %></td>
			  <td class="title_center" rowspan="2" nowrap="nowrap"><%= label.getLabelName("L_ExInfo") %></td>
			  <td class="title_center" rowspan="2" nowrap="nowrap"><%= label.getLabelName("L_ExInfo") %></td>
			  <td class="title_center" rowspan="2" nowrap="nowrap"><%= label.getLabelName("L_ExInfo") %></td>
			  
			  <td class="title_center" colspan="1" nowrap="nowrap"><%= label.getLabelName("L_ProductGroup")+1 %></td>
			  <td class="title_center" colspan="1" nowrap="nowrap"><%= label.getLabelName("L_ProductGroup")+2 %></td>
			  <td class="title_center" colspan="1" nowrap="nowrap"><%= label.getLabelName("L_ProductGroup")+3 %></td>
			  <td class="title_center" colspan="1" nowrap="nowrap"><%= label.getLabelName("L_ProductGroup")+4 %></td>
			  <td class="title_center" colspan="1" nowrap="nowrap"><%= label.getLabelName("L_ProductGroup")+5 %></td>
			  <td class="title_center" colspan="1" nowrap="nowrap"><%= label.getLabelName("L_ProductGroup")+6 %></td>
			  <td class="title_center" colspan="1" nowrap="nowrap"><%= label.getLabelName("L_ProductGroup")+7 %></td>
			  <td class="title_center" colspan="1" nowrap="nowrap"><%= label.getLabelName("L_ProductGroup")+8 %></td>
			  <td class="title_center" colspan="1" nowrap="nowrap"><%= label.getLabelName("L_ProductGroup")+9 %></td>
			  <td class="title_center" colspan="1" nowrap="nowrap"><%= label.getLabelName("L_ProductGroup")+10 %></td>
              <td class="title_center" colspan="1" nowrap="nowrap"><%= label.getLabelName("L_ProductGroup")+11 %></td>
			  <td class="title_center" colspan="1" nowrap="nowrap"><%= label.getLabelName("L_ProductGroup")+12 %></td>
			  <td class="title_center" colspan="1" nowrap="nowrap"><%= label.getLabelName("L_ProductGroup")+13 %></td>
			  <td class="title_center" colspan="1" nowrap="nowrap"><%= label.getLabelName("L_ProductGroup")+14 %></td>
			  <td class="title_center" colspan="1" nowrap="nowrap"><%= label.getLabelName("L_ProductGroup")+15 %></td>
			  <td class="title_center" colspan="1" nowrap="nowrap"><%= label.getLabelName("L_ProductGroup")+16 %></td>
			  <td class="title_center" colspan="1" nowrap="nowrap"><%= label.getLabelName("L_ProductGroup")+17 %></td>
			  <td class="title_center" colspan="1" nowrap="nowrap"><%= label.getLabelName("L_ProductGroup")+18 %></td>
			  <td class="title_center" colspan="1" nowrap="nowrap"><%= label.getLabelName("L_ProductGroup")+19 %></td>
			  <td class="title_center" colspan="1" nowrap="nowrap"><%= label.getLabelName("L_ProductGroup")+20 %></td>
              
              <td class="title_center" rowspan="2" width="8%"><%= label.getLabelName("L_ErrorMsg") %> </td>
            </tr>
            <tr class="deepblue-left">
			  <td class="title_center"><%= label.getLabelName("L_ISMAPPING") %></td>
              <td class="title_center"><%= label.getLabelName("L_ISMAPPING") %></td>
              <td class="title_center"><%= label.getLabelName("L_ISMAPPING") %></td>
			  <td class="title_center"><%= label.getLabelName("L_ISMAPPING") %></td>
              <td class="title_center"><%= label.getLabelName("L_ISMAPPING") %></td>
              <td class="title_center"><%= label.getLabelName("L_ISMAPPING") %></td>
			  <td class="title_center"><%= label.getLabelName("L_ISMAPPING") %></td>
              <td class="title_center"><%= label.getLabelName("L_ISMAPPING") %></td>
              <td class="title_center"><%= label.getLabelName("L_ISMAPPING") %></td>
			  <td class="title_center"><%= label.getLabelName("L_ISMAPPING") %></td>
			  <td class="title_center"><%= label.getLabelName("L_ISMAPPING") %></td>
              <td class="title_center"><%= label.getLabelName("L_ISMAPPING") %></td>
              <td class="title_center"><%= label.getLabelName("L_ISMAPPING") %></td>
			  <td class="title_center"><%= label.getLabelName("L_ISMAPPING") %></td>
              <td class="title_center"><%= label.getLabelName("L_ISMAPPING") %></td>
              <td class="title_center"><%= label.getLabelName("L_ISMAPPING") %></td>
			  <td class="title_center"><%= label.getLabelName("L_ISMAPPING") %></td>
              <td class="title_center"><%= label.getLabelName("L_ISMAPPING") %></td>
              <td class="title_center"><%= label.getLabelName("L_ISMAPPING") %></td>
			  <td class="title_center"><%= label.getLabelName("L_ISMAPPING") %></td>
            </tr>
<%
	int i=0;
	String strClassType="";
	String checkflag = null;
%>
            <%--  the old detail lines  --%>
 <span id="olddetail" >
            <logic:iterate id="onerow" collection="<%= totalsummary %>" indexId="idx" scope="page">
<%
	if(i%2 == 1)
	  {
	    strClassType = "td-listrom";
	  }else{                    
	    strClassType = "none";
	  }
	  i++;
	  
	  HashMap row = (HashMap)pageContext.getAttribute("onerow");
	if(row.get("errormessage") != null){
		strClassType = "need";
		
	}
	checkflag = (String)row.get("ck_flag");
%>
            <tr onMouseOver="this.className='tr-over'" onMouseOut="this.className='<%=JspHelper.filterNull( strClassType )%>'" class="<%=JspHelper.filterNull( strClassType )%>">
<!--            onClick="javascript:page_radiotrue('<oval:write name="onerow" property="temp_uploadorgid" />')"
<td class="title_center"><input type="checkbox" name="uploaduserids" value="<oval:write name="onerow" property="temp_employeeid" />"  class="normalradio"></td>-->
              <td><custom:write property="username" name="onerow"  nbsp="true"/></td>
              <td><custom:write property="employeecode" name="onerow"  nbsp="true"/></td>
              <td><custom:write property="employeename" name="onerow"  nbsp="true"/></td>              
              <td><custom:write property="statusname" name="onerow"  nbsp="true"/></td>
              <td><custom:write property="gendername" name="onerow"  nbsp="true"/></td>
              <td><custom:write property="deptname" name="onerow"  nbsp="true"/></td>
              <td><custom:write property="jobtitlename" name="onerow"  nbsp="true"/></td>              
              
              <!-- 
               -->
              <td><custom:write property="station" name="onerow"  nbsp="true"/></td> 
              <td><custom:write property="employeetype" name="onerow"  nbsp="true"/></td>
              <td><custom:write property="isbale" name="onerow"  nbsp="true"/></td>
              <td><custom:write property="educationlevelcode" name="onerow"  nbsp="true"/></td>    
                    
                    
              <td><custom:write property="marriagestatusname" name="onerow"  nbsp="true"/></td>
              <td><custom:write property="idcardnumber" name="onerow"  nbsp="true"/></td>
              <td><custom:write property="privatebankaccount" name="onerow"  nbsp="true"/></td>    
              <td><custom:write property="officephone" name="onerow"  nbsp="true"/></td>
              
              <td><custom:write property="email" name="onerow"  nbsp="true"/></td>
              <td><custom:write property="addressname" name="onerow"  nbsp="true"/></td>
              <td><custom:write property="zipcode" name="onerow"  nbsp="true"/></td>
              
              <td><custom:write property="parentusercode" name="onerow"  nbsp="true"/></td>
              <td><custom:write property="parentusername" name="onerow"  nbsp="true"/></td>
              
              <td><custom:write property="issalesman" name="onerow"  nbsp="true"/></td>          
              <!-- 
               -->
              <td><custom:write property="provincesmanagercode" name="onerow"  nbsp="true"/></td> 
              <td><custom:write property="provincesmanagername" name="onerow"  nbsp="true"/></td> 
              
         
               
              <td><custom:write property="businessarea" name="onerow"  nbsp="true"/></td>
              <td><custom:write property="entrydate" name="onerow"  nbsp="true"/></td>
              <td><custom:write property="leavedate" name="onerow"  nbsp="true"/></td>
              
              <td><custom:write property="staffturnovertime" name="onerow"  nbsp="true"/></td>
              
              <td><custom:write property="userqty" name="onerow"  nbsp="true"/></td>
              <td><custom:write property="usedqty" name="onerow"  nbsp="true"/></td>
              <td><custom:write property="businesstype" name="onerow"  nbsp="true"/></td>
              <td><custom:write property="birthday" name="onerow"  nbsp="true"/></td>
              
              <td><custom:write property="attr101" name="onerow"  nbsp="true"/></td>
              <td><custom:write property="attr102" name="onerow"  nbsp="true"/></td>
              <td><custom:write property="attr103" name="onerow"  nbsp="true"/></td>
              <td><custom:write property="attr104" name="onerow"  nbsp="true"/></td>
              <td><custom:write property="attr105" name="onerow"  nbsp="true"/></td>
              
              <td><custom:write property="ismapping1" name="onerow"  nbsp="true"/></td>
              <td><custom:write property="ismapping2" name="onerow"  nbsp="true"/></td>
              <td><custom:write property="ismapping3" name="onerow"  nbsp="true"/></td> 
              <td><custom:write property="ismapping4" name="onerow"  nbsp="true"/></td> 
              <td><custom:write property="ismapping5" name="onerow"  nbsp="true"/></td> 
              <td><custom:write property="ismapping6" name="onerow"  nbsp="true"/></td> 
              <td><custom:write property="ismapping7" name="onerow"  nbsp="true"/></td> 
              <td><custom:write property="ismapping8" name="onerow"  nbsp="true"/></td> 
              <td><custom:write property="ismapping9" name="onerow"  nbsp="true"/></td>  
              <td><custom:write property="ismapping10" name="onerow"  nbsp="true"/></td> 
              <td><custom:write property="ismapping11" name="onerow"  nbsp="true"/></td>
              <td><custom:write property="ismapping12" name="onerow"  nbsp="true"/></td>
              <td><custom:write property="ismapping13" name="onerow"  nbsp="true"/></td> 
              <td><custom:write property="ismapping14" name="onerow"  nbsp="true"/></td> 
              <td><custom:write property="ismapping15" name="onerow"  nbsp="true"/></td> 
              <td><custom:write property="ismapping16" name="onerow"  nbsp="true"/></td> 
              <td><custom:write property="ismapping17" name="onerow"  nbsp="true"/></td> 
              <td><custom:write property="ismapping18" name="onerow"  nbsp="true"/></td> 
              <td><custom:write property="ismapping19" name="onerow"  nbsp="true"/></td>  
              <td><custom:write property="ismapping20" name="onerow"  nbsp="true"/></td> 
              

              <td><custom:write property="errormessage" name="onerow" nbsp="true"/></td>
            </tr>

            </logic:iterate>
</span>
			<tr>
				<td colspan="66" align="left"><%= label.getLabelName("L_TotalData") + label.getLabelName("L_Colon") %><custom:write property="count" name="count" nbsp="true"/></td>
			</tr>

            <%@ include file="/inc/SummaryActionUP.inc" %>
          </table>
</div>
          <table width="100%" cellspacing="0" cellpadding="0">
            <tr><td class="summary_top"></td></tr>
            <tr>
              <td class="td_center">
	      		<%if (totalsummary.size() > 0){ 
					if(checkflag == null){
				%>
				                <a onclick="page_check();"><custom:button type="1" label="L_CheckContent" imgsrc="new.gif" border="0" style="width:60"/></a>
				<%}else if(("Y").equals(checkflag)){ %>                
				                <a onclick="javascript:page_print();"><custom:button type="1" label="L_Execcd" imgsrc="new.gif" border="0" style="width:60"/></a>				           
				                <a onclick="javascript:page_confirm();"><custom:button type="1" label="L_Confirm" imgsrc="new.gif" border="0" style="width:60"/></a> 
				                <a onclick="javascript:page_giveup();"><custom:button type="1" label="L_GiveUp" imgsrc="new.gif" border="0" style="width:60"/></a> 
							<!--<a onclick="javascript:page_confirm1();"><custom:button type="1" label="L_Confirm" imgsrc="new.gif" border="0" style="width:60"/></a>
							<a onclick="javascript:page_submit();"><custom:button type="1" label="L_Submit_batch" imgsrc="new.gif" border="0" style="width:60"/></a> -->  	
		                
				<%}else if(("N").equals(checkflag)){ %>
				                <a onclick="javascript:page_print();"><custom:button type="1" label="L_Execcd" imgsrc="new.gif" border="0" style="width:60"/></a>				           
				                
				                <a onclick="javascript:page_giveup();"><custom:button type="1" label="L_GiveUp" imgsrc="new.gif" border="0" style="width:60"/></a>									                
				<%}}%>      
              </td>
            </tr>
          </table>
        </td>
      </tr>
    </table>
</form>
</body>
</html>